package com.css.dzj.dzjap.modules.project.supervision.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.util.Date;
import java.util.Objects;

/**
 * 监管工作(主表)
 * @author liyuan
 */
@Entity
@Table(name = "AP_SUPERVISION", schema = "DZJAP", catalog = "")
public class Supervision {
    private String suId;
    // 现在变为监管项目标题名称
    private String projectName;
    private String projectType;
    private String suType;
    private String suTime;
    // 监管结果：0符合要求、1责令整改、2处罚
    private String suResult;
    private String suExplain;
    // 填报日期
    private Date suCreateTime;
    private String suCreateUser;
    private String suCreateDepartment;
    private String suRemark;
    private String checkUser;
    private String checkOrg;
    // 审核结果：0同意，1不同意
    private String checkResult;
    private String checkView;
    private String createUser;
    private String createUserType;
    private Date createTime;
    private String updateUser;
    private Date updateTime;
    private String delFlag;
    // 上报状态，0未上报，1已上报
    private String reportStatus;
    // 默认为0未提交、1已提交待审核、2 审核未通过、3审核已通过
    private String checkStatus;
    // 存用户组织地址，若组织名称为：北京市地震局-->只存北京市
    private String projectAddress;
    // 拟制公开公告 0：未拟制，1：已拟制
    private String noticeStatus;
    // 组织等级用来区分用户，0：中国地震局，1：省级地震局，2：地市级地震局
    private String orgLevel;

    @Id
    @Column(name = "SU_ID")
    /*@GeneratedValue(generator = "idGenerator")
    @GenericGenerator(name = "idGenerator", strategy = "com.css.dzj.dzjap.common.util.SnowflakeId")*/
    public String getSuId() {
        return suId;
    }

    public void setSuId(String suId) {
        this.suId = suId;
    }

    @Basic
    @Column(name = "PROJECT_NAME")
    public String getProjectName() {
        return projectName;
    }

    public void setProjectName(String projectName) {
        this.projectName = projectName;
    }

    @Basic
    @Column(name = "PROJECT_TYPE")
    public String getProjectType() {
        return projectType;
    }

    public void setProjectType(String projectType) {
        this.projectType = projectType;
    }

    @Basic
    @Column(name = "SU_TYPE")
    public String getSuType() {
        return suType;
    }

    public void setSuType(String suType) {
        this.suType = suType;
    }

    @Basic
    @Column(name = "SU_TIME")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8")
    public String getSuTime() {
        return suTime;
    }

    public void setSuTime(String suTime) {
        this.suTime = suTime;
    }

    @Basic
    @Column(name = "SU_RESULT")
    public String getSuResult() {
        return suResult;
    }

    public void setSuResult(String suResult) {
        this.suResult = suResult;
    }

    @Basic
    @Column(name = "SU_EXPLAIN")
    public String getSuExplain() {
        return suExplain;
    }

    public void setSuExplain(String suExplain) {
        this.suExplain = suExplain;
    }

    @Basic
    @Column(name = "SU_CREATE_TIME")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8")
    public Date getSuCreateTime() {
        return suCreateTime;
    }

    public void setSuCreateTime(Date suCreateTime) {
        this.suCreateTime = suCreateTime;
    }

    @Basic
    @Column(name = "SU_CREATE_USER")
    public String getSuCreateUser() {
        return suCreateUser;
    }

    public void setSuCreateUser(String suCreateUser) {
        this.suCreateUser = suCreateUser;
    }

    @Basic
    @Column(name = "SU_CREATE_DEPARTMENT")
    public String getSuCreateDepartment() {
        return suCreateDepartment;
    }

    public void setSuCreateDepartment(String suCreateDepartment) {
        this.suCreateDepartment = suCreateDepartment;
    }

    @Basic
    @Column(name = "SU_REMARK")
    public String getSuRemark() {
        return suRemark;
    }

    public void setSuRemark(String suRemark) {
        this.suRemark = suRemark;
    }

    @Basic
    @Column(name = "CHECK_USER")
    public String getCheckUser() {
        return checkUser;
    }

    public void setCheckUser(String checkUser) {
        this.checkUser = checkUser;
    }

    @Basic
    @Column(name = "CHECK_ORG")
    public String getCheckOrg() {
        return checkOrg;
    }

    public void setCheckOrg(String checkOrg) {
        this.checkOrg = checkOrg;
    }

    @Basic
    @Column(name = "CHECK_RESULT")
    public String getCheckResult() {
        return checkResult;
    }

    public void setCheckResult(String checkResult) {
        this.checkResult = checkResult;
    }

    @Basic
    @Column(name = "CHECK_VIEW")
    public String getCheckView() {
        return checkView;
    }

    public void setCheckView(String checkView) {
        this.checkView = checkView;
    }

    @Basic
    @Column(name = "CREATE_USER")
    public String getCreateUser() {
        return createUser;
    }

    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }

    @Basic
    @Column(name = "CREATE_USER_TYPE")
    public String getCreateUserType() {
        return createUserType;
    }

    public void setCreateUserType(String createUserType) {
        this.createUserType = createUserType;
    }

    @Basic
    @Column(name = "CREATE_TIME")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Basic
    @Column(name = "UPDATE_USER")
    public String getUpdateUser() {
        return updateUser;
    }

    public void setUpdateUser(String updateUser) {
        this.updateUser = updateUser;
    }

    @Basic
    @Column(name = "UPDATE_TIME")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    @Basic
    @Column(name = "DEL_FLAG")
    public String getDelFlag() {
        return delFlag;
    }

    public void setDelFlag(String delFlag) {
        this.delFlag = delFlag;
    }

    @Basic
    @Column(name = "REPORT_STATUS")
    public String getReportStatus() {
        return reportStatus;
    }

    public void setReportStatus(String reportStatus) {
        this.reportStatus = reportStatus;
    }

    @Basic
    @Column(name = "CHECK_STATUS")
    public String getCheckStatus() {
        return checkStatus;
    }

    public void setCheckStatus(String checkStatus) {
        this.checkStatus = checkStatus;
    }

    @Basic
    @Column(name = "PROJECT_ADDRESS")
    public String getProjectAddress() {
        return projectAddress;
    }

    public void setProjectAddress(String projectAddress) {
        this.projectAddress = projectAddress;
    }

    @Basic
    @Column(name = "NOTICE_STATUS")
    public String getNoticeStatus() {
        return noticeStatus;
    }

    public void setNoticeStatus(String noticeStatus) {
        this.noticeStatus = noticeStatus;
    }

    @Basic
    @Column(name = "ORG_LEVEL")
    public String getOrgLevel() {
        return orgLevel;
    }

    public void setOrgLevel(String orgLevel) {
        this.orgLevel = orgLevel;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Supervision that = (Supervision) o;
        return Objects.equals(suId, that.suId) &&
                Objects.equals(projectName, that.projectName) &&
                Objects.equals(projectType, that.projectType) &&
                Objects.equals(suType, that.suType) &&
                Objects.equals(suTime, that.suTime) &&
                Objects.equals(suResult, that.suResult) &&
                Objects.equals(suExplain, that.suExplain) &&
                Objects.equals(suCreateTime, that.suCreateTime) &&
                Objects.equals(suCreateUser, that.suCreateUser) &&
                Objects.equals(suCreateDepartment, that.suCreateDepartment) &&
                Objects.equals(suRemark, that.suRemark) &&
                Objects.equals(checkUser, that.checkUser) &&
                Objects.equals(checkOrg, that.checkOrg) &&
                Objects.equals(checkResult, that.checkResult) &&
                Objects.equals(checkView, that.checkView) &&
                Objects.equals(createUser, that.createUser) &&
                Objects.equals(createUserType, that.createUserType) &&
                Objects.equals(createTime, that.createTime) &&
                Objects.equals(updateUser, that.updateUser) &&
                Objects.equals(updateTime, that.updateTime) &&
                Objects.equals(delFlag, that.delFlag) &&
                Objects.equals(reportStatus, that.reportStatus) &&
                Objects.equals(checkStatus, that.checkStatus) &&
                Objects.equals(projectAddress, that.projectAddress) &&
                Objects.equals(noticeStatus, that.noticeStatus) &&
                Objects.equals(orgLevel, that.orgLevel);
    }

    @Override
    public int hashCode() {
        return Objects.hash(suId, projectName, projectType, suType, suTime, suResult, suExplain, suCreateTime, suCreateUser, suCreateDepartment, suRemark, checkUser, checkOrg, checkResult, checkView, createUser, createUserType, createTime, updateUser, updateTime, delFlag, reportStatus, checkStatus, projectAddress, noticeStatus, orgLevel);
    }
}
